import cv2
import ddddocr

slide = ddddocr.DdddOcr(det=False, ocr=False)

with open('bg.jpg', 'rb') as f:
    target_bytes = f.read()

with open('fullpage.jpg', 'rb') as f:
    background_bytes = f.read()

img = cv2.imread("bg.jpg")

res = slide.slide_comparison(target_bytes, background_bytes)

print(res)